<?php
namespace app\admin\logic;

use app\admin\model\AuthRule;

class IndexLogic{
    public static function   getIndexList(){
        $list=AuthRule::authRuleList()->toArray();
        $arr=[];
        foreach ($list as $v){
            if ($v['pid']==0){$arr[]=$v;}
        }
        foreach ($arr as &$v){
            foreach ($list as $vv){
                if ($v['id']==$vv['pid']){$v['next'][]=$vv;}
            }
        }
        return $arr;
    }
}